import Vue from 'vue'
import App from './App'
//上传方法
import * as Upload from '@/common/utils/uploadHelper.js'
//常用方法库
import * as Common from '@/common/utils/commonHelper.js'
//本地存储封装
import * as Db from '@/common/utils/dbHelper.js'
//全局常量配置
import * as GlobalConstVars from '@/common/setting/constVarsHelper.js'

import store from '@/common/store'

//引入全局uView
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)


// #ifdef MP
// 引入uView对小程序分享的mixin封装
let mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)
// #endif

//全局引用常量配置文件,用于template内代码使用
Vue.mixin({
    data() {
        return {
            $globalConstVars: GlobalConstVars
        }
    }
})

//引入全局自定义mixin，主要用于在template内代码使用方法
import mixinsHelper from "@/common/mixins/mixinsHelper.js"
Vue.mixin(mixinsHelper)


Vue.config.productionTip = false
Vue.prototype.$upload = Upload;
Vue.prototype.$common = Common;
Vue.prototype.$db = Db;
Vue.prototype.$globalConstVars = GlobalConstVars;
Vue.prototype.$store = store;


App.mpType = 'app'

const app = new Vue({
    ...App
})

// 引入请求封装
require('@/common/request/request')(app)

// http接口API集中管理引入部分
import httpApi from '@/common/request/http.api.js'
Vue.use(httpApi, app)

app.$mount()
